package LeetCodeP;

public class Solution461 {

    public static  int hammingDistance(int x, int y) {
        if (x==y){
            return 0;
        }
        if (x%2==y%2){
            return hammingDistance(x>>1,y>>1);
        }
        return hammingDistance(x>>1,y>>1)+1;

    }
    public  static  int hammingDistance1(int x, int y) {
        return Integer.bitCount(x^y);
    }
    public static void main(String[] args) {
        int x = 1, y = 4;
        int i = hammingDistance1(x, y);
        System.out.println(i);
    }
}
